package leetcode_601_700;

public class LeeCode_657 {
    public static void main(String[] args) {

    }
    private static boolean judgeCircle(String moves) {
        int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
        for (int i = 0; i < moves.length(); i++) {
            switch (moves.charAt(i)){
                case 'U':{
                    c1++;
                    break;
                }
                case 'D':{
                    c2++;
                    break;
                }
                case 'L':{
                    c3++;
                    break;
                }
                case 'R':{
                    c4++;
                    break;
                }
            }
        }
        return c1 == c2 && c3 == c4;
    }
}
